import Vue from 'vue'
import Router from 'vue-router'
import Home from '../pages/Home'

Vue.use(Router)

export default new Router({
  linkActiveClass: "is-active",
  routes: [{
    path: '/',
    component: Home,
    redirect: "/index",
    children: [{
      path: 'index',
      component: resolve => {
        require(["../pages/Index"], resolve)
      }
    },
    {
      path:'collect',
      component: resolve =>{
        require(["../pages/Collect"],resolve)
      }
    },
    {
      path:'circle',
      component:resolve =>{
        require(["../pages/Circle"],resolve)
      }
    },
    {
      path:'users',
      component:resolve =>{
        require(["../pages/Users"],resolve)
      }
    },
    {
      path:'register',
      component:resolve =>{
        require(["../pages/Register"],resolve)
      }
    },
    {
      path:'forget',
      component:resolve =>{
        require(["../pages/Forget.vue"],resolve)
      }
    }]
  },
  {
    path:"/book/:id",
    component:resolve=>{
      require(["../pages/Book"],resolve)
    }
  },
  {
    path:"/details/:did",
    component:resolve=>{
      require(["../pages/Details"],resolve)
    }
  },
  {
    path:"/article/:artid",
    component:resolve=>{
      require(["../pages/Article"],resolve)
    }
  }]
})
